package com.example.yjhplayer.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yc.yjh.entity.Statistics;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author ly
 * @since 2023-07-25
 */
public interface StatisticsMapper extends BaseMapper<Statistics> {

    @Select("select s.*,h.name as \"heroes.name\",h.icon as \"heroes.icon\",count(h.hero_id) as \"heroes.heroId\"  from  statistics s " +
            "inner join heroes h  on h.hero_id=s.hero_id where  player_id=#{player_id} group by h.hero_id")
    List<Statistics> findhero(@Param("player_id") int playerId);

}
